home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / progsrc / microcad / microcad.doc < prev    next >
Encoding:
Text File  |  1994-02-16  |  15.5 KB  |  406 lines

  1. MICROCAD is a very small drawing program (less than 12k!)
  2.  
  3. It has commands for drawing/erasing/moving/copying such things as lines,
  4. boxes, circles, arcs, graphical text and other drawings as "group" objects.
  5. It also features a "display" mode, where it can be used as a simple viewer,
  6. and includes an MCPRINT utility to print your drawings.
  7.  
  8. This is not a serious drafting package, however the complete MICRO-C source
  9. code to MICROCAD is available free of charge from our BBS, and should prove
  10. quite useful to anyone wishing to experiment with a drawing editor.
  11.  
  12. In its current form, MICROCAD requires a mouse, a VGA display (it works
  13. at 640x480), and either an HP LASERJET or EPSON DOT-MATRIX printer. It
  14. should be fairly easy to modify it for compatibility with other devices.
  15.  
  16.  
  17. The MICROCAD command:
  18. --------------------
  19.  
  20. The MICROCAD command has the following syntax:
  21.  
  22.    MICROCAD [drawing file] [F=font file] [/Display]
  23.  
  24.    [drawing file] is the name of a file containing a drawing that you
  25. wish to edit. The extension '.DWG' is assumed. If you do not specify a
  26. file name, MICROCAD assumes its default name MICROCAD.DWG. This default
  27. drawing file normally contains a blank drawing, and is used only to
  28. establish the default settings for the "S)etup" values.
  29.  
  30.    [font file] is the name of a file containing a character set font that
  31. will be used to display any text in the drawing file. If you do not specify
  32. a font file, The default MICROCAD.FNT is assumed.
  33.  
  34.    [/Display] causes MICROCAD to act as a viewer. The mouse is not
  35. activated, the grid is disabled (even if it is turned on in the drawing),
  36. and the drawing is displayed. Pressing any key will terminate the MICROCAD
  37. at this point.
  38.  
  39. Mouse:
  40. -----
  41.  
  42. MICROCAD uses only the LEFT and RIGHT mouse buttons, allowing it to be
  43. used with either a two or three button pointing device.
  44.  
  45. When sitting at the top command level (no command text visible at the
  46. top of the screen), the mouse buttons function as follows:
  47.  
  48.    LEFT   - Brings up the command menu at the top of the screen. Pressing
  49.             the key corrsponding to a command will active that command.
  50.  
  51.    RIGHT  - Activates the last command that you executed. This is a useful
  52.             way to perform multiple operations, such as drawing multiple
  53.             box's etc.
  54.  
  55. Unless noted otherwise, the mouse buttons behave as follows once a command
  56. has been activated:
  57.  
  58.    LEFT   - Performs an operation for which you are being prompted at the
  59.             top of the screen. Some commands may have several locations that
  60.             have to be selected. For each location, you will receive a
  61.             prompt at the top of the screen. Simply move the mouse pointer
  62.             to the desired location, and press the LEFT button.
  63.  
  64.    RIGHT  - Cancels the operation. In most cases this will return you directly
  65.             to the top command level (no command active). In some cases, this
  66.             will cancel a sub-function, and permit you to continue with the
  67.             command.
  68.  
  69. Main COMMANDS:
  70. -------------
  71.  
  72. The following commands are available from within MICROCAD at the top
  73. command level.
  74.  
  75. A)rc
  76.  
  77. Prompts you for a "center" point, a starting point, and an ending point.
  78. Draws an arc clockwise from the starting point to the ending point, which
  79. would be a portion of a circle centered about the center point.
  80.  
  81. B)ox
  82.  
  83. This command prompts you to select two corners, and after the second
  84. one is selected, MICROCAD will draw a BOX with diagonal corners on those
  85. points.
  86.  
  87. C)ircle
  88.  
  89. Prompts you to select a center point, and then a second point. MICROCAD
  90. will draw a circle about the center point, which includes the second point
  91. in its circumference.
  92.  
  93. D)up
  94.  
  95. Prompts you to select an object, and then for a new insertion point. The
  96. object is copied to the new point. Most useful for duplicating a "group"
  97. that you have included from another file, or insuring that you get a circle
  98. of exactly the same size etc. Duplicating an object takes only 7 bytes in
  99. the drawing file, no matter how large or complicated the object is.
  100.  
  101. See the E)rase command below for details on selecting an object.
  102.  
  103. E)rase
  104.  
  105. Prompts you to select an object. To select an object, you must position
  106. the cursor over the BASE POINT of that object. In general, the base point
  107. will be the first point that you selected when defining the object.
  108.  
  109. To make it easier for you, MICROCAD constantly watches the cursor
  110. position when this command is executed, and selects any object who's
  111. base point comes in contact with the cursor. Once an object is selected,
  112. MICROCAD indicates so, by temporarily removing it from the screen. Press
  113. the LEFT button to accept this, and permanently erase the object.
  114.  
  115. If you accidently select an object that you don't want to erase, just
  116. move the cursor away from it, and press the RIGHT button. MICROCAD will
  117. restore it to the screen, and continue to search for other objects.
  118.  
  119. If more than one object has its base point at the same location, MICROCAD
  120. will select the one which was defined first. You may accept this with the
  121. LEFT button, or press the RIGHT button to switch to the next oldest one.
  122. If you wish to cancel the selection in this case, you must keep pressing the
  123. RIGHT button until all objects at that location have been skipped.
  124.  
  125. You may use the S)etup / B)ase-markers command to cause the base points
  126. of all objects in the drawing to be made visible.
  127.  
  128. F)unc
  129.  
  130. This command brings up menu of misc. functions:
  131.  
  132.    F)ont
  133.  
  134.    Prompts you for a new character font file, and if given, loads it, and
  135.    re-draws the drawing, using the new font.
  136.  
  137.    I)nsert
  138.  
  139.    Prompts you for a drawing filename, and then an insertion point. Inserts
  140.    the contents of that drawing into the current drawing as a single object.
  141.    The base point of the new object is the upper left corner of an invisible
  142.    box, just large enough to include all object base points in the included
  143.    drawing. This point will be shown by the cursor while selecting the new
  144.    object location.
  145.  
  146.    If you wish to insert the same drawing several times, it takes much less
  147.    space in the drawing file if you insert it once, and then use the duplicate
  148.    function to create the other instances.
  149.  
  150.    L)oad
  151.  
  152.    Prompts for a filename, and loads a drawing from that file. Any unsaved
  153.    changes to the current drawing are lost.
  154.  
  155.    Q)uit
  156.  
  157.    Terminates MICROCAD.
  158.  
  159.    S)ave
  160.  
  161.    Prompts for a filename, and saves the current drawing to that file.
  162.  
  163. L)ine
  164.  
  165. Prompts for a starting point, and then a series of end points. Each
  166. time you select a new point, a line is drawn to it from the previous point.
  167. Press the RIGHT button to stop drawing lines.
  168.  
  169. M)ove
  170.  
  171. Prompts you to select an object, and then for its new base point.
  172. The object is then repositioned in the drawing.
  173.  
  174. See the 'E)rase' command for details on selecting an object.
  175.  
  176. R)edraw
  177.  
  178. Redisplays the drawing. This is useful to see any objects which are
  179. overwritten by the text line at the top of the screen, and to "fix"
  180. any breaks in lines, or missing grid markers causes by erasing of
  181. overlaid objects.
  182.  
  183. S)etup
  184.  
  185. Brings up a menu of setup subcommands:
  186.  
  187.    B)ase-markers
  188.  
  189.    This command toggles ON/OFF the display of base points. See E)rase command
  190.    for a description of base points. When ON, the base point for each object
  191.    in the drawing will appear surrounded by a tiny box.
  192.  
  193.    C)urser-base
  194.  
  195.    Prompts you to select a base point for the cursor. After you select one,
  196.    the cursor position shown in the upper right corner of the screen, will
  197.    be relative to this position.
  198.  
  199.    G)rid
  200.  
  201.    Prompts for the spacing (in pixels) of the grid markers. Entering a
  202.    blank line, or a value of zero turns off grid markers. Grid markers
  203.    are simply "dots" placed at regular intervals, which you can use
  204.    as a reference for aligning objects etc.
  205.  
  206.    S)nap
  207.  
  208.    Prompt for the spacing of "snap stops". When snap is enabled, the
  209.    cursor is forced to "snap" into a grid of evenly placed stops. This
  210.    makes it MUCH easier to align objects that you create. The "snap" grid
  211.    should normally be set to some even fraction of the "G)rid" markers,
  212.    although this is not enforced. Entering a blank line, or a value of
  213.    zero turns off "snap", allowing the cursor to roam free.
  214.  
  215.    T)ext-scale
  216.  
  217.    This defines the size of text characters. Only affects text created
  218.    after this command is used, allowing you to have several different
  219.    sizes of text in the same drawing.
  220.  
  221.    The character set fonts used by MICROCAD are built on a matrix which
  222.    is 16 pixels wide, by 24 pixels high. A scale value of 100 indicates
  223.    that this original size will be used. A value of 50 would result in
  224.    characters half as high and wide, while 200 would double the height
  225.    and width.
  226.  
  227. NOTE: All of the above settings are saved in the drawing file, and will
  228. therefore be restored when you subsequently edit the drawing.
  229.  
  230. T)ext
  231.  
  232. Inserts a text string into the drawing. You will be prompted for the
  233. string to be inserted, and then for the position in the drawing.
  234.  
  235. U)ndo
  236.  
  237. Erases the last object which was created. Undo may be repeated, and each
  238. time the youngest living object is removed. NOTE that U)ndo cannot reverse
  239. operations like M)ove or E)rase.
  240.  
  241. MCPRINT Utility:
  242. ---------------
  243.  
  244. MICROCAD now includes MCPRINT.COM, which will print your drawing on an
  245. HP LaserJet series or EPSON dot-matrix printer. MCPRINT works by building
  246. a raster bitmap from your drawing, and then sending it to the printer. It
  247. should be fairly easy to modify MCPRINT to work with other printers.
  248.  
  249. The syntax of the MCPRINT command is:
  250.  
  251.    MCPRINT <drawing file> <printer type> [F=font file] [D=device]
  252.  
  253.    <drawing file> is the name of a file containing the drawing that you
  254. wish to print. The extension '.DWG' is assumed.
  255.  
  256.    <printer type> indicates which kind of printer you have. It should be
  257. either LASERJET or EPSON.
  258.  
  259.    [font file] is the name of a file containing a character set font that
  260. will be used to display any text in the drawing file. If you do not specify
  261. a font file, The default MICROCAD.FNT is assumed.
  262.  
  263.    [device] is the DOS device to which the printer output will be written.
  264. If you do not specify one, "LPT1" is assumed. You may also use this option
  265. to direct the output to a file.
  266.  
  267. Misc. Notes:
  268. -----------
  269.  
  270. MICROCAD does all of its internal calculations using 16 bit arithmetic.
  271. Bacause of this, circles or arcs having a very large radius may not display
  272. correctly. This is because these objects require manipulation of squares of
  273. values, which may overflow 16 bits.
  274.  
  275. The GRID markers are not recorded as part of the object, and will "disappear"
  276. if you M)ove, E)rase or U)ndo something that was on top of them. They will be
  277. restored any time the screen is redrawn.
  278.  
  279. Character Fonts:
  280. ---------------
  281.  
  282. The following characters font files are included with MICROCAD:
  283.  
  284.    MICROCAD.FNT - This is the default MICROCAD font. It is a reasonable
  285.                   quality font, which scales fairly well.
  286.    HIGHRES.FNT  - This is a higher quality font, however it does not
  287.                   scale to small sizes quite as well as MICROCAD.FNT.
  288.    MATRIX.FNT   - A low (8x8) resolution font which looks like the
  289.                   output from a dot matrix printer.
  290.    THINLINE.FNT - A thin spidery font.
  291.  
  292. MICROCAD also includes a "font editor" (FE.COM) which allows you to create
  293. and edit your own font files. The program is fairly self explainatory, just
  294. run it and specify the name of the font file as an argument.
  295.  
  296. Drawing File Format:
  297. -------------------
  298.  
  299. All entries in the drawing files produced by MICROCAD consist of 8 bit bytes
  300. and 16 bit words. Word values are stored with the most significant byte first.
  301.  
  302. The first few bytes of the drawing file contain the "S)etup" values:
  303.  
  304.    Word = Grid spacing (0 = disable)
  305.    Word = Snap spacing (0 = disable)
  306.    Word = Text scale (100 = 1:1)
  307.    Word = Cursor base X position
  308.    Word = Cursor base Y position
  309.    Byte = Basepoint display: 0 = ON, 1=OFF
  310.  
  311. Following the settings, the file will contain zero or more "objects",
  312. representing lines, circles etc. The form of each type of object is:
  313.  
  314. END:    Byte = 0x00
  315.         This is not required by MICROCAD, and is not normally produced by
  316.         the program, however, an object consisting of a single 0x00 byte
  317.         causes MICROCAD to stop drawing. This has two effects:
  318.          1- If you are going to transmit the file using a protocol such as
  319.             XMODEM which adds garbage to the end of the file, you could first
  320.             append an END object to avoid "Corrupt drawing file".
  321.          2- Once the END object is encountered, further additions to the
  322.             drawing although recorded, are not displayed when the file is
  323.             redrawn or reloaded.
  324.  
  325. LINE:   Byte = 0x01
  326.         Word = Absolute X position of first point
  327.         Word = Absolute Y position of first point
  328.         Word = Relative X position of second point
  329.         Word = Relative Y position of second point
  330.  
  331. BOX:    Byte = 0x02
  332.         Word = Absolute X position of first point
  333.         Word = Absolute Y position of first point
  334.         Word = Relative X position of second point
  335.         Word = Relative Y position of second point
  336.  
  337. CIRCLE: Byte = 0x03
  338.         Word = Absolute X position of center point
  339.         Word = Absolute Y position of center point
  340.         Word = Radius of circle
  341.  
  342. TEXT:   Byte = 0x04
  343.         Word = Absolute X position of text
  344.         Word = Absolute Y position of text
  345.         Word = Scale of text (100 = 1:1 = 16x24)
  346.         Bytes= Text string
  347.         Byte = 0 (zero termination)
  348.  
  349. ARC:    Byte = 0x05
  350.         Word = Absolute X position of center point
  351.         Word = Absolute Y position of center point
  352.         Word = Radius of arc
  353.         Word = Angle (0-255) to starting point.
  354.         Word = Angle (0-255) to ending point.
  355.         Angle:  0 
  356.                 |
  357.           192 --+-- 64
  358.                 |
  359.                128
  360.  
  361. GROUP:  Byte = 0x06
  362.         Word = Abolute X position of group
  363.         Word = Abolute Y position of group
  364.         Word = Size of following objects (in bytes)
  365.         ...    Zero of more objects follow...
  366.                X/Y positions are relative to group start.
  367.  
  368. ACOPY:  Byte = 0x07
  369.         Word = Absolute X position of copy
  370.         Word = Absolute Y position of copy
  371.         Word = Byte offset of copied object from first object in file
  372.  
  373. RCOPY:  Byte = 0x08
  374.         Word = Absolute X position of copy
  375.         Word = Absolute Y position of copy
  376.         Word = Byte offset of copied object from beginning of this object
  377.  
  378. The absolute copy is used whenever an object is duplicated via the D)up
  379. function in MICROCAD. This form is more easy to manipulate when dealing
  380. with discrete objects.
  381.  
  382. When objects are "grouped" (a drawing is inserted), any ACOPY objects are
  383. changed to the relative RCOPY, so that we do not have to worry about them
  384. shifting due to E)rase etc. This makes it much easier to treat the entire
  385. group as a single object. This is safe to do, since the ACOPY must reference
  386. an object in the same group, and the contents of a group are never altered.
  387.         
  388.  
  389. Finally:
  390. -------
  391.  
  392. If anyone significantly enhances MICROCAD, or does something else truly
  393. useful with it, I'd like to see the results.
  394.  
  395.       Dave Dunfield
  396.       Dunfield Development Systems
  397.       P.O. Box 31044
  398.       Nepean, Ontario Canada
  399.       K2B 8S8
  400.       TEL: (613) 256-5820     FAX: (613) 256-5821
  401.  
  402.  
  403. MICROCAD, MCPRINT, MCDRAW and FE are compiled using the PC version of my
  404. MICRO-C compiler. For more information on MICRO-C and my other products,
  405. see the CATALOG file in this archive.
  406.